 
<gm:page title="universityPortal" css="/css/g.css" class="googleTheme" authenticate="true" >

  <!-- data sources -->
  <!-- per usare i dati di test, basta cambiare ${user} in ${test} -->
      
  <gm:data id="userCourses" data="${user}/courses" />
  <gm:data id="userInfo" data="${user}/info" />
  <gm:data id="userEnrollment" data="${user}/enrollment" />
  <gm:data id="userExams" data="${user}/exams" />
  <gm:data id="userPayments" data="${user}/payments" />
    
  <gm:tabs target="universityContainer"/>

  
    
  <gm:container id="universityContainer" style="padding:3px;border:1px solid #369;width:600px;">
    
    <!-- where the student can see / change his/her personal data -->
    <gm:section id="infoSection" title="Informazioni">

      <gm:item src="${userInfo}" template="infoItems" create="true" />  
            
    </gm:section>

    <gm:section id="enrollSection" title="Inquadramento">

      <gm:list src="${userEnrollment}" template="enrollItems" />  
      
    </gm:section>               

    <gm:section id="paymentsSection" title="Pagamenti">

      <gm:list src="${userPayments}" template="paymentItems" />  
        
    </gm:section>
                                                                                              
    <gm:section id="coursesSection" title="Materie">

      <gm:list src="${userCourses}" template="courseItems" />  
      
    </gm:section>

    <gm:section id="examsSection" title="Esami">

      <gm:list src="${userExams}" template="examItems" />  

    </gm:section>
        
  </gm:container>

  <gm:template id="infoItems">
    
    <table class="gm-table" style="padding:3px;border:1px solid #369;width:560px;">
     <table>
       <tr><td>Nome</td><td><gm:text ref="atom:name"/></td></tr>
       <tr><td>Cognome</td><td><gm:text ref="atom:surname"/></td></tr>
       <tr><td>Data di Nascita</td><td><gm:text ref="atom:birthday"/></td></tr>
       <tr><td>Codice Fiscale</td><td><gm:text ref="atom:personalID"/></td></tr>
       <tr><td>Studente Lavoratore</td><td><gm:checkbox ref="atom:worker"/></td></tr>
       <tr><td>Premio di Immatricolazione</td><td><gm:text ref="atom:enroll_prize"/></td></tr>

        <!--gm:item template="t" data="${app}/test" create="true" /-->
       <tr>
         <td colspan="2" style="padding-top:10px"><gm:editButtons text="true"/></td>
       </tr>
     </table>
  
  </gm:template>    
 
  <gm:template id="enrollItems">
    
    <table class="gm-table" style="padding:3px;border:1px solid #369;width:560px;">
      <tr repeat="true">
        <th><gm:text ref="atom:name" /></th>
        <th><gm:text ref="atom:value" /></th>
      </tr>
    </table>
    
  </gm:template>   
      
  <gm:template id="courseItems">
    
    <table class="gm-table" style="padding:3px;border:1px solid #369;width:560px;">
      <tr>
        <th>Codice</th>
        <th>Sigla</th>
        <th>Crediti</th>
        <th>Nome Completo</th>
        <th>Docente</th>
      </tr>
      <tr repeat="true">
        <th><gm:text ref="atom:code" /></th>
        <th><gm:text ref="atom:title" /></th>
        <th><gm:text ref="atom:credits" /></th>
        <td><gm:text ref="atom:name" /></td>
        <td><gm:text ref="atom:teacher" /></td>
        <td><gm:editButtons deleteOnly="true" /></td>
      </tr>
    </table>
    <p></p>
    <div style="text-align:right">
      <gm:create label="Aggiungi..." />
    </div>    
    
  </gm:template>

  <gm:template id="examItems">
    
    <table class="gm-table" style="padding:3px;border:1px solid #369;width:560px;">
      <tr>
        <th>Codice</th>
        <th>Sigla</th>
        <th>Crediti</th>
        <th>Nome Completo</th>
        <th>Docente</th>
        <th>Data</th>
        <th>Voto</th>
      </tr>
      <tr repeat="true">
        <th><gm:text ref="atom:code" /></th>
        <th><gm:text ref="atom:title" /></th>
        <th><gm:text ref="atom:credits" /></th>
        <td><gm:text ref="atom:name" /></td>
        <td><gm:text ref="atom:teacher" /></td>
        <td><gm:text ref="atom:date" /></td>
        <td><gm:text ref="atom:result" /></td>
      </tr>
    </table>
    
  </gm:template>
    
  <gm:template id="paymentItems">
    
    <table class="gm-table" style="padding:3px;border:1px solid #369;width:560px;">
      <tr>
        <th>Data</th>
        <th>Importo</th>
        <th>Metodo</th>
        <th>Causale</th>
      </tr>
      <tr repeat="true">
        <td><gm:text ref="atom:date" /></td>
        <td><gm:text ref="atom:value" /></td>
        <td><gm:text ref="atom:mode" /></td>
        <td><gm:text ref="atom:note" /></td>
      </tr>
    </table>
    <p></p>
    <div style="text-align:right">
      <gm:create label="Aggiungi..." />
    </div>    
    
  </gm:template>

</gm:page>